<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
      <el-form-item label="投手" prop="uid">
        <el-select v-model="queryParams.uid" placeholder="请选择投手" clearable>
          <el-option
            v-for="dict in peoList"
            :key="dict.userId"
            :label="dict.userName"
            :value="dict.userId"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="Countries" prop="countries">
        <el-input
          v-model="queryParams.countries"
          placeholder="请输入Countries"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="域名地址" prop="url">
        <el-select v-model="queryParams.url" placeholder="请选择域名地址" clearable>
          <el-option
            v-for="dict in realms"
            :key="dict.id"
            :label="dict.url"
            :value="dict.url"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="平台" prop="plat">
        <el-select v-model="queryParams.plat" placeholder="请选择平台" clearable>
          <el-option
            v-for="dict in dict.type.pl_info"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
          <el-option
            v-for="dict in dict.type.gd_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="审核状态" prop="audStatus">
        <el-select v-model="queryParams.cloakStatus" placeholder="请选择审核状态" clearable>
          <el-option
            v-for="dict in dict.type.aud_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="斗篷状态" prop="cloakStatus">
        <el-select v-model="queryParams.cloakStatus" placeholder="请选择斗篷状态" clearable>
          <el-option
            v-for="dict in dict.type.aqy_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="安全页状态" prop="safeStatus">
        <el-select v-model="queryParams.safeStatus" placeholder="请选择安全页状态" clearable>
          <el-option
            v-for="dict in dict.type.aqy_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="创建时间">
            <el-date-picker
              v-model="dateRange"
              style="width: 240px"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
      <!-- <el-form-item label="安全页地址" prop="safeUrl">
        <el-input
          v-model="queryParams.safeUrl"
          placeholder="请输入安全页地址"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:workOrder:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:workOrder:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:workOrder:remove']"
        >删除</el-button>
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:workOrder:export']"
        >导出</el-button>
      </el-col> -->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="workOrderList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="投手" align="center" prop="sysUser.nickName" />
      <el-table-column label="Countries" align="center" prop="countries" width="120"/>
      <el-table-column label="点击数（总）" align="center" prop="view" width="120">
        <template slot-scope="scope">
          <el-link type="primary" @click="openView(scope.row)">{{ scope.row.view }}</el-link>
        </template>
      </el-table-column>
      <el-table-column label="有效点击数（总）" align="center" prop="eView" width="120">
        <template slot-scope="scope">
          <el-link type="primary" @click="openEView(scope.row)">{{ scope.row.eView }}</el-link>
        </template>
      </el-table-column>
      <el-table-column label="点击数（日）" align="center" prop="viewNow" width="120">
        <template slot-scope="scope">
          <el-link type="primary" >{{ scope.row.viewNow }}</el-link>
        </template>
      </el-table-column>
      <el-table-column label="有效点击数（日）" align="center" prop="eViewNow" width="120">
        <template slot-scope="scope">
          <el-link type="primary">{{ scope.row.eViewNow }}</el-link>
        </template>
      </el-table-column>
      <el-table-column label="跳转地址" align="center" prop="eViewNow" width="300">
        <template slot-scope="scope">
          <el-link type="primary" :href="`http://` + scope.row.url + '/link/' + scope.row.id" target="_blank">{{`http://` + scope.row.url + '/link/' + scope.row.id}}</el-link>
        </template>
      </el-table-column>
      <!-- <el-table-column label="Node" align="center" prop="node" /> -->
      <!-- <el-table-column label="域名地址" align="center" prop="url" width="150">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.aqy_status" :value="scope.row.url"/>
        </template>
      </el-table-column> -->
      <el-table-column label="平台" align="center" prop="plat">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.pl_info" :value="scope.row.plat"/>
        </template>
      </el-table-column>
      <el-table-column label="斗篷状态" align="center" prop="cloakStatus">
        <template slot-scope="scope">
          <el-switch
            v-model="scope.row.cloakStatus"
              :active-value="1"
              :inactive-value="0"
              @change="handleStatusChange(scope.row)"
            ></el-switch>
        </template>
      </el-table-column>
      <el-table-column label="过滤记录" align="center" prop="plat">
        <template slot-scope="scope">
          <el-link type="primary" @click="lookLead(scope.row)">查看记录</el-link>
        </template>
      </el-table-column>
      <el-table-column label="过滤链接" align="center" prop="plat">
        <template slot-scope="scope">
          <el-link type="primary" @click="fzfw(scope.row)">复制链接</el-link>
        </template>
      </el-table-column>
      <!-- <el-table-column label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <el-switch
            v-model="scope.row.status"
              :active-value="1"
              :inactive-value="0"
              @change="handleStatusChange(scope.row)"
            ></el-switch>
        </template>
      </el-table-column> -->
      <!-- <el-table-column label="审核状态" align="center" prop="audStatus">
        <template slot-scope="scope">
          <el-switch
            v-model="scope.row.audStatus"
              :active-value="1"
              :inactive-value="0"
              @change="handleStatusChange(scope.row)"
            ></el-switch>
        </template>
      </el-table-column> -->
      <el-table-column label="允许访问国家(多个国家请使用英文逗号隔开)" align="center" prop="support" width="300"/>
      <!-- <el-table-column label="像素ID" align="center" prop="pixel"/> -->
      
      <!-- <el-table-column label="安全页状态" align="center" prop="safeStatus" width="120">
        <template slot-scope="scope">
          <el-switch
            v-model="scope.row.safeStatus"
              :active-value="1"
              :inactive-value="0"
              @change="handleStatusChange(scope.row)"
            ></el-switch>
        </template>
      </el-table-column> -->
      <el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
      <!-- <el-table-column label="安全页地址" align="center" prop="safeUrl" /> -->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  width="200" fixed="right">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-document"
            @click="handleDetails(scope.row)"
            v-hasPermi="['system:workOrder:query']"
          >详情</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:workOrder:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:workOrder:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改投放对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <!-- <el-form-item label="管理ID" prop="uid">
          <el-input v-model="form.uid" placeholder="请输入管理ID" />
        </el-form-item> -->
        <el-form-item label="Countries" prop="countries">
          <el-input v-model="form.countries" placeholder="请输入Countries" />
        </el-form-item>
        <el-form-item label="Node" prop="node">
          <el-input v-model="form.node" type="textarea" rows="6" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="允许访问国家(多个国家请使用英文逗号隔开)" prop="support">
          <el-input v-model="form.support" type="textarea" rows="6" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="域名地址" prop="url">
          <el-select v-model="form.url" placeholder="请选择域名地址">
            <el-option
              v-for="dict in realms"
              :key="dict.id"
              :label="dict.url"
              :value="dict.url"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="平台" prop="plat">
          <el-select v-model="form.plat" placeholder="请选择平台">
            <el-option
              v-for="dict in dict.type.pl_info"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="状态" prop="status">
          <el-switch
            v-model="form.status"
              :active-value="1"
              :inactive-value="0"
              @change="handleStatusChange(scope.row)"
            ></el-switch>
        </el-form-item>
        <el-form-item label="审核状态" prop="audStatus">
          <el-switch
            v-model="form.audStatus"
              :active-value="1"
              :inactive-value="0"
              @change="handleStatusChange(scope.row)"
            ></el-switch>
        </el-form-item> -->
        <el-form-item label="斗篷状态" prop="cloakStatus">
          <el-switch
            v-model="form.cloakStatus"
              :active-value="1"
              :inactive-value="0"
            ></el-switch>
        </el-form-item>
        <!-- <el-form-item label="像素ID" prop="pixel">
          <el-input v-model="form.pixel" type="textarea" placeholder="请输入像素ID" />
        </el-form-item> -->
        <!-- <el-form-item label="安全页状态" prop="safeStatus">
          <el-switch
            v-model="form.safeStatus"
              :active-value="1"
              :inactive-value="0"
            ></el-switch>
        </el-form-item> -->
        <el-form-item label="安全页地址" prop="safeUrl">
          <el-input v-model="form.safeUrl" placeholder="请输入安全页地址" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 详情 -->
    <el-dialog title="工单详情" :visible.sync="openDetail" width="1600px" append-to-body>
      <div class="title">
        跳转地址：<el-link style="font-size: 25px;" type="primary" :href="`http://` + item.url + '/link/' + item.id" target="_blank">{{`http://` + item.url + '/link/' + item.id}}</el-link>
      </div>
      <div class="fz" @click="copyInfo(item)">点击复制链接</div>
      <el-row>
        <el-col :span="6" class="info">工单ID：{{ item.id }}</el-col>
        <el-col :span="6" class="info">点击总数：{{ item.eView }}</el-col>
        <el-col :span="6" class="info">平台：{{ item.support }}</el-col>
        <el-col :span="6" class="info">备注：{{ item.node }}</el-col>
        <el-col :span="6" class="info">状态：有效</el-col>
        <el-col :span="6" class="info">有效点击数：{{ item.view }}</el-col>
        <el-col :span="6" class="info">国家：{{ item.countries }}</el-col>
        <el-col :span="6" class="info">创建时间：{{ item.createTime }}</el-col>
      </el-row>
      <el-divider></el-divider>
      <item :limit="itemId"></item>
      <el-divider></el-divider>
    </el-dialog>
    <el-dialog title="点击数（总）详情" :visible.sync="openViewFast" width="1600px" append-to-body>
      <el-table :data="accessRecordsList">
        <el-table-column label="ID" align="center" prop="id" />
        <!-- <el-table-column label="工单ID" align="center" prop="workOrderId" /> -->
        <el-table-column label="IP地址" align="center" prop="ip" />
        <el-table-column label="创建时间" align="center" prop="createTime" />
      </el-table>
      
      <pagination
        v-show="total2>0"
        :total="total2"
        :page.sync="queryParams2.pageNum"
        :limit.sync="queryParams2.pageSize"
        @pagination="getList2"
      />
    </el-dialog>
    <el-dialog title="有效点击数（总）详情" :visible.sync="openEViewFast" width="1600px" append-to-body>
      <el-table :data="efficAccessRecordsList">
        <el-table-column label="ID" align="center" prop="id" />
        <!-- <el-table-column label="工单ID" align="center" prop="workOrderId" /> -->
        <el-table-column label="IP地址" align="center" prop="ip" />
        <el-table-column label="创建时间" align="center" prop="createTime" />
      </el-table>
      
      <pagination
        v-show="total3>0"
        :total="total3"
        :page.sync="queryParams3.pageNum"
        :limit.sync="queryParams3.pageSize"
        @pagination="getList3"
      />
    </el-dialog>

    <el-dialog title="过滤记录" :visible.sync="openLead" width="1600px" append-to-body>
      <el-form :model="queryParams4" ref="queryForm4" size="small" :inline="true" label-width="88px">
        <!-- <el-form-item label="访问IP" prop="ip">
          <el-input
            v-model="queryParams4.ip"
            placeholder="请输入访问IP"
            clearable
            @keyup.enter.native="handleQuery4"
          />
        </el-form-item> -->
        <el-form-item label="真实IP" prop="realIp">
          <el-input
            v-model="queryParams4.realIp"
            placeholder="请输入真实IP"
            clearable
            @keyup.enter.native="handleQuery4"
          />
        </el-form-item>
        <el-form-item label="设备" prop="agent">
          <el-input
            v-model="queryParams4.agent"
            placeholder="请输入设备"
            clearable
            @keyup.enter.native="handleQuery4"
          />
        </el-form-item>
        <el-form-item label="来源" prop="accept">
          <el-input
            v-model="queryParams4.realIp"
            placeholder="请输入来源"
            clearable
            @keyup.enter.native="handleQuery4"
          />
        </el-form-item>
        <el-form-item label="浏览器语言" prop="acceptLua">
          <el-input
            v-model="queryParams4.acceptLua"
            placeholder="请输入浏览器语言"
            clearable
            @keyup.enter.native="handleQuery4"
          />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery4">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery4">重置</el-button>
        </el-form-item>
      </el-form>
      <el-table :data="leachRecordsList">
        <el-table-column label="ID" align="center" prop="id" />
        <el-table-column label="工单ID" align="center" prop="workOrderId" />
        <el-table-column label="访问IP" align="center" prop="ip" />
        <el-table-column label="请求数据" align="center" prop="body" :show-overflow-tooltip="true" />
        <el-table-column label="返回结果" align="center" prop="result" :show-overflow-tooltip="true" />
        <el-table-column label="真实IP" align="center" prop="realIp" />
        <el-table-column label="设备" align="center" prop="agent" :show-overflow-tooltip="true"/>
        <el-table-column label="来源" align="center" prop="accept" :show-overflow-tooltip="true"/>
        <el-table-column label="浏览器语言" align="center" prop="acceptLua" :show-overflow-tooltip="true"/>
        <el-table-column label="是否通过" align="center" prop="adopt">
          <template slot-scope="scope">
            <span style="color: #F56C6C;" v-if="scope.row.adopt === 0">不通过</span>
            <span style="color: #67C23A;" v-if="scope.row.adopt === 1">通过</span>
          </template>
        </el-table-column>
        <el-table-column label="创建时间" align="center" prop="createTime" />
      </el-table>
    
      <pagination
        v-show="total4>0"
        :total="total4"
        :page.sync="queryParams4.pageNum"
        :limit.sync="queryParams4.pageSize"
        @pagination="getList4"
      />
    </el-dialog>
  </div>
</template>

<script>
import { listWorkOrder, getWorkOrder, delWorkOrder, addWorkOrder, updateWorkOrder, getRealmList,getPeoples } from "@/api/app/workOrder";
import { listAccessRecords} from "@/api/app/accessRecords";
import { listEfficAccessRecords} from "@/api/app/efficAccessRecords";
import { listLeachRecords } from "@/api/app/leachRecords";
import item  from "./item.vue";
export default {
  name: "WorkOrder",
  dicts: ['gd_status', 'aud_status', 'pl_info', 'aqy_status'],
  components:{
    item
  },
  data() {
    return {
      item:{},
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 投放表格数据
      workOrderList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      openDetail:false,openViewFast:false,openEViewFast:false,openLead:false,
      // 日期范围
      dateRange: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        uid: null,
        countries: null,
        node: null,
        support: null,
        url: null,
        plat: null,
        status: null,
        audStatus: null,
        cloakStatus:null,
        safeStatus: null,
        safeUrl: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        countries: [
          { required: true, message: "Countries不能为空", trigger: "blur" }
        ],
        node: [
          { required: true, message: "Node不能为空", trigger: "blur" }
        ],
        support: [
          { required: true, message: "允许访问国家(多个国家请使用英文逗号隔开)不能为空", trigger: "blur" }
        ],
        url: [
          { required: true, message: "域名地址不能为空", trigger: "change" }
        ],
        plat: [
          { required: true, message: "平台不能为空", trigger: "change" }
        ],
        status: [
          { required: true, message: "状态不能为空", trigger: "change" }
        ],
        audStatus: [
          { required: true, message: "审核状态不能为空", trigger: "change" }
        ],
        safeStatus: [
          { required: true, message: "安全页状态不能为空", trigger: "change" }
        ],
        safeUrl: [
          { required: true, message: "安全页地址不能为空", trigger: "blur" }
        ],
      },
      realms:[],
      itemId:'',
      peoList:[],
      queryParams2: {
        pageNum: 1,
        pageSize: 10,
        workOrderId: null,
        ip: null,
      }, 
      total2:0,total3:0,accessRecordsList:[],efficAccessRecordsList:[],leachRecordsList:[],
      queryParams3: {
        pageNum: 1,
        pageSize: 10,
        workOrderId: null,
        ip: null,
      },
      total4:0,
      queryParams4: {
        pageNum: 1,
        pageSize: 10,
        workOrderId: null,
        ip: null,
        body: null,
        result: null,
        adopt: null,
        headers: null,
        cookies: null,
        realIp: null,
        agent: null,
        accept: null,
        acceptLua: null
      },
    };
  },
  created() {
    this.getList();
    this.getRealm();
    this.getPeo();
  },
  methods: {
    //查询投手
    getPeo(){
      getPeoples().then(res=>{
        this.peoList = res.data;
      })
    },
    /** 查询域名地址列表 */
    getRealm() {
      getRealmList().then(res=>{
        this.realms = res.data;
      })
    },
    /** 查询投放列表 */
    getList() {
      this.loading = true;
      listWorkOrder(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
        this.workOrderList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        uid: null,
        countries: null,
        node: null,
        support: null,
        url: null,
        plat: null,
        status: 0,
        audStatus: 0,
        pixel:null,
        cloakStatus:1,
        safeStatus: 0,
        safeUrl: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.getRealm();
      this.open = true;
      this.title = "添加工地";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getWorkOrder(id).then(response => {
        this.form = response.data;
        this.getRealm();
        this.open = true;
        this.title = "修改工单";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateWorkOrder(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addWorkOrder(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除工单编号为"' + ids + '"的数据项？').then(function() {
        return delWorkOrder(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/workOrder/export', {
        ...this.queryParams
      }, `workOrder_${new Date().getTime()}.xlsx`)
    },
    handleDetails(row){
      this.item = row
      this.itemId = row.id
      this.openDetail = true;
    },
    async copyInfo(item){
      try{
        await navigator.clipboard.writeText('http://'+item.url+'/link/'+item.id);
        this.$modal.msgSuccess("复制成功");
      }catch(err){
        console.log("复制文本失败",err)
      }
    },
    handleStatusChange(row){
      updateWorkOrder(row).then(response => {
        this.$modal.msgSuccess("操作成功");
        this.getList();
      });
    },
    openView(row){
      console.log(22222)
      this.queryParams2.workOrderId = row.id;
      this.queryParams2.pageNum = 1;
      this.getList2();
      this.openViewFast = true;
    },
    openEView(row){
      this.queryParams3.workOrderId = row.id;
      this.queryParams3.Num = 1;
      this.getList3();
      this.openEViewFast = true;
    },
    /** 查询访问记录列表 */
    getList2() {
      listAccessRecords(this.queryParams2).then(response => {
        this.accessRecordsList = response.rows;
        this.total2 = response.total;
      });
    },
     /** 查询有效访问记录列表 */
     getList3() {
      listEfficAccessRecords(this.queryParams3).then(response => {
        this.efficAccessRecordsList = response.rows;
        this.total3 = response.total;
      });
    },
    lookLead(row){
      this.queryParams4.workOrderId = row.id;
      this.getList4();
      this.openLead = true;
    },
    getList4() {
      listLeachRecords(this.queryParams4).then(response => {
        this.leachRecordsList = response.rows;
        this.total4 = response.total;
      });
    },
    /** 搜索按钮操作4 */
    handleQuery4() {
      this.queryParams4.pageNum = 1;
      this.getList4();
    },
      /** 重置按钮操作4 */
    resetQuery4() {
      this.resetForm("queryForm4");
      this.handleQuery4();
    },
    async fzfw(row){
      try{
        // await navigator.clipboard.writeText('https://vue.ipdamao.com/leach/'+row.id);
        await navigator.clipboard.writeText('http://localhost/leach/'+row.id);
        this.$modal.msgSuccess("复制成功");
      }catch(err){
        console.log("复制文本失败",err)
      }
    },
  }
};
</script>
<style scoped>
.title{
  color: #000000;
  font-size: 25px;
  margin-bottom: 20px;
}
.fz{
  color: #409EFF;
  font-size: 16px;
  margin-bottom: 40px
}
.info{
  margin-bottom: 40px;
  font-size: 16px;
}
</style>
